home *** CD-ROM | disk | FTP | other *** search
- // GETINFO SCRIPTING
- // Imports movies info (RU) with picture from Friends-Forum.com
- // (±) Ilya 2005
- program FriendsForum;
- const
- BaseAddress = 'http://www.friends-forum.com/';
- var
- MovieName: string;
-
- function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
- var
- i: Integer;
- begin
- result := -1;
- if StartAt < 0 then
- StartAt := 0;
- for i := StartAt to List.Count-1 do
- if Pos(Pattern, List.GetString(i)) <> 0 then
- begin
- result := i;
- Break;
- end;
- end;
-
- procedure AnalyzePage(Address: string); //╧εΦ±Ω ⌠Φδⁿ∞εΓ Φ ⌠ε≡∞Φ≡εΓαφΦσ ±∩Φ±Ωα
- var
- ID, FilmName, Line: String;
- Page: TStringList;
- FilmPage: TStringList;
- BeginPos, EndPos, Lines: Integer;
- begin
- Page := TStringList.Create;
- Page.Text := GetPage(Address);
- BeginPos := FindLine('<TH bgcolor="#FF9900"><font class=A_white>╬ ╘Φδⁿ∞σ</font></TH></tr>', Page,0);
- EndPos := FindLine('ΣεßαΓΦ≥ⁿ Γ ∞εΘ Ωα≥αδεπ', Page,0);
- if BeginPos> 0 then
- begin
- Line:='';
- for Lines := BeginPos+1 to EndPos do //╧εδ≤≈σφΦσ ±≥≡εΩ ± φατΓαφΦ ∞Φ Φ αΣ≡σ±α∞Φ
- Line:=Line+Page.GetString(Lines);
- PickTreeClear; //╬≈Φ±≥Ωα Σσ≡σΓα ⌠Φδⁿ∞εΓ
- PickTreeAdd('╧εΦ±Ω ∩ε ±δεΓ≤: ' + MovieName, '');
- repeat
- BeginPos := Pos('<td align=center><A HREF="modules.php?name=Movie_News&file=preview&id',Line);
- If BeginPos>0 Then
- Begin
- Delete(Line,1,BeginPos); //╙ΣαδσφΦσ φα≈αδα
- BeginPos:=26;
- EndPos := Pos('"><center><b>',Line);
- ID := copy(Line, BeginPos, EndPos - BeginPos); //╧εδ≤≈Φ≥ⁿ αΣ≡σ± ±≥≡αφΦ÷√ ⌠Φδⁿ∞α
- BeginPos := Pos('"><center><b>',Line)+12;
- Delete(Line,1,BeginPos);
- BeginPos := 1;
- EndPos := Pos('</b></A><br>',Line)-1;
- FilmName := Copy(Line, BeginPos, EndPos); //╧εδ≤≈Φ≥ⁿ φατΓαφΦσ ⌠Φδⁿ∞α
- FilmName := StringReplace(FilmName,' ',' ');
- PickTreeAdd(FilmName, BaseAddress + ID);
- end;
- until BeginPos < 1;
- end;
- If PickTreeExec(Address) Then
- AnalyzeMoviePage(Address);
- end;
-
- procedure AnalyzeMoviePage(Address: String); //╧εδ≤≈σφΦσ Φφ⌠ε≡∞α÷ΦΦ ε Γ√ß≡αφε∞ ⌠Φδⁿ∞σ
- var
- Page: TStringList;
- LineNr : Integer;
- Line, Value : String;
- BeginPos, EndPos : Integer;
-
- begin
- Page := TStringList.Create;
- Page.Text := GetPage(Address);
-
- SetField(fieldURL,Address); //╧εδ≤≈σφΦσ URL
-
-
- BeginPos := FindLine('> » ╚φ⌠ε≡∞α÷Φ ε ⌠Φδⁿ∞σ', Page,0);
- EndPos := FindLine('╨σΘ≥Φφπ ∩εδⁿτεΓα≥σδσΘ</a>:</B>', Page,0);
-
- Line:='';
- for LineNr := BeginPos to EndPos do //╧εδ≤≈Φ≥ⁿ ±≥≡εΩΦ ± Φφ⌠ε≡∞α÷ΦσΘ
- Line:=Line+Page.GetString(LineNr);
-
- Value := ''; //Φ∞∩ε≡≥ Ωα≡≥ΦφΩΦ
- BeginPos := Pos('<IMG SRC="',Line)+10;
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := pos('">', Line);
- if copy(Line, BeginPos, 1) = '/' then
- Value := 'http://www.friends-forum.com/';
- Value := Value + copy(Line, BeginPos, EndPos - BeginPos);
- GetPicture(Value, False);
-
- BeginPos := Pos('<B>═ατΓαφΦσ:</B>',Line)+16; //∩σ≡σΓσΣσφφεσ φατΓαφΦσ
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldTranslatedTitle,Value);
-
- BeginPos := pos('╬≡ΦπΦφαδⁿφεσ φατΓαφΦσ', Line)+26; //ε≡ΦπΦφαδⁿφεσ φατΓαφΦσ
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);;
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldOriginalTitle, Value);
-
- BeginPos := pos('Γ√⌡εΣα', Line)+10; //πεΣ
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := BeginPos+5;
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldYear, Value);
-
- BeginPos := pos('╞αφ≡', Line)+9; //µαφ≡
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldCategory, Value);
-
- BeginPos := pos('╨σµΦ±±σ≡', Line)+13; //≡σµΦ±±σ≡
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldDirector, Value);
-
- BeginPos := pos('≡εδ ⌡', Line)+10; //Γ ≡εδ ⌡
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldActors, Value);
-
- BeginPos := pos('⌠Φδⁿ∞σ', Line)+11; //╬ ⌠Φδⁿ∞σ
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldDescription,Value);
-
- BeginPos := pos('┬√∩≤∙σφε', Line)+13; //±≥≤ΣΦ (∩≡εΣ■±σ≡)
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldProducer, Value);
-
- BeginPos := pos('▀τ√Ω', Line)+9; // τ√Ω
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos(' </TD></TR>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldLanguages, Value);
-
- BeginPos := pos('╧≡Φ∞σ≈αφΦ ', Line)+15; //Ωε∞σφ≥α≡ΦΦ
- Delete(Line,1,BeginPos);
- BeginPos :=1;
- EndPos := Pos('</td></tr>',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- SetField(fieldComments, Value);
-
- BeginPos := Pos('╨σΘ≥Φφπ ∩εδⁿτεΓα≥σδσΘ</a>:</B>',Line)+31; //≡σΘ≥Φφπ (Ωα≈σ±≥Γε)
- EndPos := Pos(' / 10 (',Line);
- Value := copy(Line, BeginPos, EndPos - BeginPos);
- Value := Trim(Left(StringReplace(Value, '.', ' '),2));
- Value := IntToStr(StrToInt(Value,0));
- SetField(fieldRating,Value);
-
- DisplayResults;
- end;
-
-
- begin
- MovieName := GetField(fieldOriginalTitle);
- if MovieName = '' then
- MovieName := GetField(fieldTranslatedTitle);
- if Input('╧εΦ±Ω φα Friends-Forum.com', '┬ΓσΣΦ≥σ φατΓαφΦσ ⌠Φδⁿ∞α:', MovieName) then
- AnalyzePage('http://www.friends-forum.com/modules.php?name=Movie_News&file=index&orderfield=&direct=&pagenum=&searchterm='+UrlEncode(MovieName)+'&category=%C2%F1%E5&vlang=&let=&rezhiser=&artist=&format=%C2%F1%E5&kachestvo=%C2%F1%E5&storynum=100');
- end.
-